package com.demo.coupon;


import com.demo.AppletConstant;
import com.demo.util.Utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 赠送优惠券结果查询
 *
 */
public class CouponQuery {
	public static SimpleDateFormat SDF_HMS = new SimpleDateFormat("yyyyMMdd");

	public static void main(String[] args)  throws Exception{

		//调用接口地址
		String url = "https://open.95516.com/open/access/1.0/coupon.query";
		
		//拼装参数Map
		Map<String, String> params = new HashMap<String, String>(0);
		params.put("appId", AppletConstant.APP_ID);
		//交易流水号,不重复，最大64位
		params.put("origTransSeqId", "");
		params.put("origTransTs", "");
		params.put("transSeqId", "");
		params.put("transTs", SDF_HMS.format(new Date()));
		params.put("backendToken", AppletConstant.backendToken);

		//发送请求
		String resultStr = Utils.sendPostGson(url, params);
		
		System.out.println("-------赠送优惠券结果查询:"+resultStr+"---------");
	}
	
}
